package com.selenium.test;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;

public class SearchBySeries extends SeleneseTestCase {
	@Before
	public void setUp() throws Exception {
		selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://green-mediavault.appspot.com/");
		selenium.start();
	}

	@Test
	public void testSearchBySeries() throws Exception {
		selenium.open("/index.jsp");
		selenium.click("id=videos");
		selenium.waitForPageToLoad("30000");
		selenium.select("name=typeOfSearch", "label=Series");
		selenium.type("name=content", "Series 1");
		selenium.click("css=input[type=\"submit\"]");
		selenium.waitForPageToLoad("30000");
		assertFalse(selenium.isTextPresent("Fake Video 3, Series 2"));
	}

	@After
	public void tearDown() throws Exception {
		selenium.stop();
	}
}
